
var host = Host.CreateDefaultBuilder();
//host.ConfigureWebHostDefaults(builder => builder.UseStartup<Startup>());
host.ConfigureWebHostDefaults(builder =>
    builder
        .ConfigureServices(services => services.AddApplication<BookStoreModule>())
        .Configure(app => app.InitializeApplication())
).UseAutofac();
var app = host.Build();
app.Run();





//var builder = WebApplication.CreateBuilder(args);
//builder.Services.AddApplication<BookStoreModule>();

//var app = builder.Build();

//app.InitializeApplication();

//app.MapControllerRoute(
//    name: "default",
//    pattern: "{controller=Home}/{action=Index}/{id?}");

//app.Run();

//public class Startup
//{
//    public void ConfigureServices(IServiceCollection services)
//    {
//        services.AddApplication<BookStoreModule>();
//    }
//    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
//    {
//        app.InitializeApplication();
//    }
//}